{% extends 'base.html' %}

{% block content %}

<form method="post">
    {% csrf_token %}
    {% if interview %}
   		 <h1>Candidate : {{ interview.candidate.name }}</h1>
       <h3>Position : {{ interview.position.name }}</h3>
       <h3>Round: {{ round.name }}</h3>
       <h3>Round Date: {{ round.date }}, {{ round.contact_time }}</h3>
       <h3>Taken By: {{ round.assignee.username }}</h3>
    {% endif %}
   	{% if round %}
    <hr>

      <p><h2> Please fill below fields</h2> </p>
      <table class="table">
          <tr>
            <th>Aspect Title</th>
            <th>Details</th>
            <th>Min Expected Rating</th>
            <th>Comments</th>
            <th>Rating</th>
          </tr>

          {% for aspect in interview.position.rating_sheet.aspect_set.all %}
          <tr>

            <td>{{ aspect }}</td>
            <td>{{ aspect.description }}</td>
            <td>{{ aspect.expected_rate }}</td>
            <input type="hidden" value={{ aspect.expected_rate }} name="{{ aspect }}_expected_rate" />
            <td><input type="text" size="45" name="{{aspect}}_comment"></td>
            <td>
              <select name="{{aspect}}_aspect"><
              {% for num in rating_range %}
                <option value={{num}}>{{num}}</option>
                {% endfor %}
              </select>
            </td>
          </tr>
        {% endfor %}
        </table>

      <p>Final Comments: <input type="text" size="100" name="comments" id="finalComments"></p>
   		<input class="btn btn-lg btn-primary" type="submit" value="Submit" /> <a class="btn btn-lg btn-danger" href="{% url 'Evaluator:interview_details' interview.pk %}">Cancel</a>
   	{% else %}
   		<h3>No rounds found</h3>
   	{% endif %}

</form>
<hr>

{% endblock %}
